feat(reporter): Substantial rework of the reporter to make it more modular, functional, and standalone#3784
Merged
feat(reporter): Substantial rework of the reporter to make it more modular, functional, and standalone#3784
Conversation
…d, self-contained, and have additional functionality
tido64
reviewed
Sep 25, 2025
Member
tido64
left a comment
There was a problem hiding this comment.
Overall, I'm mostly concerned with how much overhead this adds given that this package's main purpose is logging and performance measurement. I've caught some issues like over-allocating objects but I'm pretty sure this just scratches the surface. Where possible, we should look at using Node's own implementation and use that as much possible.
Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
Saadnajmi
reviewed
Sep 29, 2025
tido64
approved these changes
Sep 30, 2025
Member
tido64
left a comment
There was a problem hiding this comment.
This is a tentative approve. I still think we're not leveraging existing standards that will allow using external tools like Chrome Dev Tools.
Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
tido64
approved these changes
Sep 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is a substantial rework of the reporter, aligning more closely with what the code in OMR has and needs going forward. It gets rid of the chalk dependency, switches to esmodules, can be built, bundled and tree-shaken without side-effects and pulling in just what it needs.
Rather than just going through everything I copied the readme contents for the rest of this comment:
From README.md
This is a common package for logging output to the console and/or logfiles,
timing tasks and operations, and listening for events for task start, finish,
and errors.
It is written as esm, side-effect free, with the functionality separated so that
it will only bring in the portions that are used. The core logger and reporter
functionality can be used on its own, with additional modules provided for
colors, formatting, performance tracking, and cascading reporters through
process trees provided.
All code is self-contained and this has no dependencies.
Core Components
🎯 Logger (
createLogger)A flexible logging system that supports multiple log levels and custom output
destinations.
Features:
error,warn,log,verbosewith hierarchical filtering📊 Reporter (
createReporter)A hierarchical task and performance tracking system built on top of the logger.
Features:
channels
🎨 Formatting & Colors
Rich text formatting with ANSI colors and semantic highlighting.
Features:
📡 Event System
Type-safe event handling using Node.js diagnostics channels.
🌊 Cascading Reporters
Share reporter configuration across process trees via environment variables.
Features:
⚡ Performance Tracking
Built-in performance monitoring that can be enabled globally.
Output Destinations
📤 Console Output
Default output to stdout/stderr with proper log level routing.
📁 File Output
Write logs to files with automatic directory creation.
🔀 Multiple Outputs
Combine multiple output destinations.
Architecture Principles
🧩 Modular Design
Each component can be used independently:
🎯 Zero Dependencies
Completely self-contained with no external dependencies, using only Node.js
built-ins.
📏 Type Safety
Comprehensive TypeScript definitions with full type inference and safety.
🔄 Side-Effect Free
ESM modules with no global state pollution - safe for library use.
⚡ Performance Focused
Common Patterns
🏗️ Build Tool Integration
🧪 Test Runner Integration
🚀 CLI Application Logging